package org.groovyflow;

import java.util.Map;


public class GroovyFlowContext {
	private static ThreadLocal holder = new ThreadLocal();
	
   public static void setMap(Map map){
	   if(holder.get() != null)
		   throw new RuntimeException("ThreadLocal was not cleared after previous use.");
	   holder.set(map);
   }
   public static Object get(Object key) {
        return  ((Map) holder.get()).get(key);
    }
   
   public static Object put(Object key, Object value) {
       return  ((Map) holder.get()).put(key, value);
   }   
   
   public static void unsetMap(){
	   holder.set(null);
   }


}
